/*
 * @Author: yangzr 1076420747@qq.com
 * @Date: 2023-04-07 18:35:48
 * @LastEditors: yangzr 1076420747@qq.com
 * @LastEditTime: 2023-05-22 17:06:13
 * @FilePath: \ktgj-crm\src\main.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Vue from 'vue'
import App from './App.vue'
import router from './router'
import axios from './common/Api/index.js'
import VueQuillEditor from 'vue-quill-editor'
import AMap from 'vue-amap'
import wsk from './common/websocket.js'
import JsonExcel from 'vue-json-excel'
import './permission'
import './common/element.js'
import * as filters from './common/filter' // global filters
import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'
import './static/styles/main.less'
import VueClipBoard from 'vue-clipboard2'
Vue.use(VueClipBoard)
Vue.use(VueQuillEditor)
Vue.use(AMap);

Vue.component('downloadExcel', JsonExcel)

// 高德地图
AMap.initAMapApiLoader({
  key: '9771164d306b63479b6677a74fab48c6',
  plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor'],
  uiVersion: '1.0'
})

Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key]) // 插入过滤器名和对应方法
})
// Vue.prototype.$wsk = wsk
// Vue.prototype.$imgHttpUrl = "https://emp.ktgj.com/backendapi/customerbackend/file/uploadPic"//生产环境
// Vue.prototype.$imgHttpAllUrl = "https://emp.ktgj.com/backendapi/customerbackend/file/uploadPicPath"//生产环境
Vue.prototype.$imgHttpUrl = "customerbackend/file/uploadPic"//测试环境
Vue.prototype.$imgHttpAllUrl = "customerbackend/file/uploadPicPath"//测试环境
Vue.prototype.$axios = axios
Vue.config.productionTip = false
// el按钮节流
Vue.directive('preventReClick', {
	inserted(el, binding) {
   	  el.addEventListener('click', () => {
     	if (!el.disabled) {
      	 el.disabled = true
      	 setTimeout(() => {
        	 el.disabled = false
       	}, binding.value || 2000)
     	}
   	})
	 }
});

new Vue({
  router,
  render: h => h(App),
}).$mount('#app')
